Skip to content

feat: dispatch version update to PTD on release#64

Merged
ian-flores merged 2 commits intomainfrom
automate-ptd-version-bump
Feb 3, 2026
Merged

feat: dispatch version update to PTD on release#64
ian-flores merged 2 commits intomainfrom
automate-ptd-version-bump

Conversation

@ian-flores
Copy link
Contributor

@ian-flores ian-flores commented Feb 2, 2026

Summary

  • Adds a notify-ptd job to the release workflow
  • After package-helm succeeds, sends a repository_dispatch event to posit-dev/ptd
  • PTD receives the event and creates a PR to update the default team-operator chart version

Setup Required

Add PTD_REPO_TOKEN secret to this repo with a PAT that has repo scope for posit-dev/ptd.

Related

Test plan

  • Merge PTD workflow first
  • Add PTD_REPO_TOKEN secret
  • Test with manual workflow_dispatch or wait for next release

Adds a notify-ptd job to the release workflow that sends a
repository_dispatch event to posit-dev/ptd after a successful
release. This triggers PTD to automatically create a PR updating
the default team-operator chart version.

Requires PTD_REPO_TOKEN secret with repo scope for posit-dev/ptd.
@claude
Copy link

claude bot commented Feb 2, 2026

Claude finished @ian-flores's task —— View job


PR Review: feat: dispatch version update to PTD on release

  • Read review guidelines
  • Get PR diff and understand changes
  • Create pending review
  • Add review comments (inline comments unavailable - included in review body)
  • Submit review

Review submitted with suggestions for:

  1. Simplifying tag retrieval using ${{ github.ref_name }} instead of re-fetching
  2. Adding error handling to the curl command

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

The workflow addition looks good overall - it correctly depends on package-helm and will notify PTD on successful releases.

Security (Elevated Scrutiny)

Credential handling: The PTD_REPO_TOKEN is properly referenced from secrets and passed via environment variable, not exposed in logs.

Suggestions

1. Redundant tag fetching (lines 119-130)

The checkout and tag fetching seem redundant since this workflow is triggered by tag pushes. Consider using ${{ github.ref_name }} directly instead of re-fetching all tags:

- name: Dispatch version update to PTD
  env:
    PTD_REPO_TOKEN: ${{ secrets.PTD_REPO_TOKEN }}
  run: |
    curl -X POST \
      -H "Accept: application/vnd.github+json" \
      -H "Authorization: Bearer $PTD_REPO_TOKEN" \
      -H "X-GitHub-Api-Version: 2022-11-28" \
      https://api.github.com/repos/posit-dev/ptd/dispatches \
      -d '{"event_type":"team-operator-release","client_payload":{"version":"${{ github.ref_name }}"}}'

This would eliminate the checkout step entirely and make the job faster.

2. Error handling (lines 137-146)

The curl command should check for a successful response. If the dispatch fails silently, you won't know until you notice PTD wasn't updated.

Consider adding error handling:

response=$(curl -s -w "\n%{http_code}" -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $PTD_REPO_TOKEN" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/posit-dev/ptd/dispatches \
  -d '{"event_type":"team-operator-release","client_payload":{"version":"${{ github.ref_name }}"}}')
http_code=$(echo "$response" | tail -1)
if [ "$http_code" -ne 204 ]; then
  echo "Failed to dispatch: HTTP $http_code"
  echo "$response"
  exit 1
fi

These are suggestions for improvement - the current implementation is functional.

env:
PTD_REPO_TOKEN: ${{ secrets.PTD_REPO_TOKEN }}
run: |
curl -X POST \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in latest commit; thanks for flagging.

Address @statik's review feedback by replacing the curl-based
repository_dispatch with gh workflow run. This is cleaner and
consistent with other gh commands in the workflow.
@ian-flores ian-flores marked this pull request as ready for review February 3, 2026 01:15
@ian-flores ian-flores requested a review from statik February 3, 2026 01:19
@ian-flores ian-flores merged commit 5f89449 into main Feb 3, 2026
2 checks passed
@ian-flores ian-flores deleted the automate-ptd-version-bump branch February 3, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants